home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / text / xes.lha / XES / REXX / LoadFile.xdme < prev    next >
Text File  |  1995-08-01  |  1KB  |  47 lines

  1. /* $VER: LoadFile.xdme 1.0 (01 Aug 1995) */
  2. /* Copyright © 1995 Fergus Duniho */
  3.  
  4. OPTIONS RESULTS
  5. ADDRESS 'XDME.1'
  6. 'rxresult $filename'
  7. filename = result
  8.  
  9. IF Exists(filename) THEN DO
  10.     CALL Open(input,filename,"R")
  11.     type = readch(input,4)
  12.     IF type = "XPKF" THEN DO
  13.         CALL Seek(input,8,"B")
  14.         method = Readch(input,4)
  15.     END
  16.     ELSE method = "NONE"
  17.     CALL Close(input)
  18. END
  19. ELSE method = "NONE"
  20. F = '(' || filename || ')'
  21.  
  22. IF method = "FEAL" | method = "IDEA" THEN DO
  23.     xcom = "execute (copy """ || filename || """ t:temp)"
  24.     xcom
  25.     body = filename "is encrypted." '0A'x || "Please enter password."
  26.     password = rtgetstring(,body,"Password Requester")
  27.     xcom = 'execute (xpack t:temp password "' || password || '")'
  28.     xcom
  29.     newfile 't:temp'
  30.     chfilename F
  31.     xcom = 'settvar password' password
  32.     xcom
  33. END
  34. ELSE newfile F
  35.  
  36. xsrc = filename || ".xsrc"
  37. IF exists(xsrc) THEN DO
  38.     source xsrc
  39. END
  40. ELSE DO
  41.     rx1 "XES:Rexx/Mode (" || filename || ")"
  42. END
  43. IF method ~= "NONE" then DO
  44.     xcom = 'settvar method' method
  45.     xcom
  46. END
  47.